package com.design;

/**
 * 测试类
 */
public class MainTest {
    public static void main(String[] args) {
        ReportVisitor simpleReportVisitor = new SimpleReportVisitor();
        ReportVisitor jsonReportVisitor = new JsonReportVisitor();
        ReportVisitor htmlReportVisitor = new HtmlReportVisitor();
        UserReport userReport = new UserReport("张三", 25, "北京市");
        SaleReport saleReport = new SaleReport("商品A", 100.0, 2);
        System.out.println("用户，简单格式输出========");
        userReport.accept(simpleReportVisitor);

        System.out.println("用户，JSON格式输出========");
        userReport.accept(jsonReportVisitor);

        System.out.println("用户，HTML格式输出========");
        userReport.accept(htmlReportVisitor);

        System.out.println("销售，简单格式输出========");
        saleReport.accept(simpleReportVisitor);

        System.out.println("销售，JSON格式输出========");
        saleReport.accept(jsonReportVisitor);

        System.out.println("销售，HTML格式输出========");
        saleReport.accept(htmlReportVisitor);
    }
}
